package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpShopBackgroundDao;
import com.financing.platform.dto.FpShopBackgroundDTO;
import com.financing.platform.service.IFpShopBackgroundService;
/**
 * fp_shop_background  
 * 背景图片表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopBackgroundService")
public class FpShopBackgroundServiceImpl implements IFpShopBackgroundService{

	@Autowired
	private IFpShopBackgroundDao fpShopBackgroundDao;

	@Override
	public int insert(FpShopBackgroundDTO fpShopBackground) throws SQLException {
//		DTOdateSetUtil.setCreateInfo(fpShopBackground);
//		DTOdateSetUtil.setUpdateInfo(fpShopBackground);
//		fpShopBackground.setDeleteTag(CommonStatus.DELETE_TAG_NORMAL);
		return fpShopBackgroundDao.insert(fpShopBackground);
	}

	@Override
	public void update(FpShopBackgroundDTO fpShopBackground) throws SQLException {
//		DTOdateSetUtil.setUpdateInfo(fpShopBackground);
		fpShopBackgroundDao.update(fpShopBackground);
	}

	@Override
	public void updateForce(FpShopBackgroundDTO fpShopBackground) throws SQLException {
//		DTOdateSetUtil.setUpdateInfo(fpShopBackground);
		fpShopBackgroundDao.updateForce(fpShopBackground);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		fpShopBackgroundDao.delete(id);
	}
	
	@Override
	public List<FpShopBackgroundDTO> queryList(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		return fpShopBackgroundDao.queryList(fpShopBackground);
	}

	@Override
	public int queryListCount(FpShopBackgroundDTO fpShopBackground) throws SQLException {
		return fpShopBackgroundDao.queryListCount(fpShopBackground);
	}

	@Override
	public FpShopBackgroundDTO loadById(Integer id) throws SQLException {
		return fpShopBackgroundDao.loadById(id);
	}
 	@Override
	public FpShopBackgroundDTO queryListGetFirst(FpShopBackgroundDTO fpShopBackground)
			throws SQLException {
		 List<FpShopBackgroundDTO> queryList = queryList(fpShopBackground);
		 if(queryList==null||queryList.size()==0){
			 return new FpShopBackgroundDTO();
		 }
		 return queryList.get(0);
	}
}
